<template>
<view>
	<!-- 头部图标 -->
	<u-sticky>
		<view class="d-waikuang-10">
			<view class="d-beijing-bai d-yuanjiao-10 ">
				<view class="d-yuanjiao-10 d-neikuang-10 ">
					<u-row
						customStyle="margin-bottom: 10px"
						gutter="10"
					>
						<u-col span="4">
							<view class="demo-layout bg-purple d-neirong-juzhong">
								<image mode="aspectFill" src="/static/images/huifu.png" class="d-yuanjiao-10 d-img-40 d-shang-10" ></image>
								<view class="d-wenzi-yanse-hui d-ziti-12">评论</view>
							</view>
						</u-col>
						<u-col span="4">
							<view class="demo-layout bg-purple d-neirong-juzhong">
								<image mode="aspectFill" src="/static/images/duanxin.png" class="d-yuanjiao-10 d-img-40 d-shang-10" ></image>
								<view class="d-wenzi-yanse-hui d-ziti-12">通知</view>
							</view>
						</u-col>
						<u-col span="4">
							<view class="demo-layout bg-purple d-neirong-juzhong">
								<image mode="aspectFill" src="/static/images/dianzan.png" class="d-yuanjiao-10 d-img-40 d-shang-10" ></image>
								<view class="d-wenzi-yanse-hui d-ziti-12">点赞</view>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</view>
	</u-sticky>
	<!-- 短信内容 -->
	<view>
		
	</view>
</view>
</template>

<script>
import toubu from "@/components/toubu/toubu";  //引入头部组件
import config from "../../utils/config";
var Api = require("../../utils/api.js");
var util = require("../../utils/util.js");

var wxApi = require("../../utils/wxApi.js");
var wxRequest = require("../../utils/wxRequest.js");
var webSiteName = config.getWebsiteName;
var domain = config.getDomain;

export default {
  data() {
    return {
      text: "消息",
      categoriesList: {},
      floatDisplay: "none",
      userInfo: {},
      webSiteName: webSiteName,
      domain: domain,
	  www: [],
	  quanlist: [],
	  
    };
  },

  components: {
	  toubu,
  },
  props: {},
  onLoad: function (options) {
    this.getWww();
	this.getQuanList();
    uni.setNavigationBarTitle({
      title: '消息'
    });


  },
  onShow: function () {},
  onShareAppMessage: function () {
    return {
      title: '分享“' + config.getWebsiteName + '”消息.',
      path: 'pages/quan/wode',
      success: function (res) {// 转发成功
      },
      fail: function (res) {// 转发失败
      }
    };
  },
  methods: {
	//获取站点
	getWww() {
	  	var self = this;
	  	self.setData({
	  	  www: []
	  	});
	  	var getTubiaoRequest = wxRequest.getRequest(Api.getWwwUrl());
	  	getTubiaoRequest.then(response => {
	  		if (response.data.code == 1) {
	  		  //console.log(response.data.data); 
	  		  self.www = response.data.data
	  		} else {
	  		  self.setData({
	  			displaySwiper: "none"
	  		  });
	  		}
	  	});
	},
	//获取圈子列表
	getQuanList() {
	  	var self = this;
	  	self.setData({
	  	  quanlist: []
	  	});
	  	var getQuanListRequest = wxRequest.getRequest(Api.getQuanlistUrl());
	  	getQuanListRequest.then(response => {
	  		if (response.data.code == 1) {
	  		  //console.log(response.data.data); 
	  		  self.quanlist = response.data.data
	  		} else {
	  		  self.setData({
	  			displaySwiper: "none"
	  		  });
	  		}
	  	});
	},

    reloadData: function (id) {
      var self = this;
      var newCategoriesList = [];
      var categoriesList = self.categoriesList;

      for (var i = 0; i < categoriesList.length; i++) {
        if (categoriesList[i].id == id) {}

        newCategoriesList.push(categoriesList[i]);
      }

      if (newCategoriesList.length > 0) {
        self.setData({
          categoriesList: newCategoriesList
        });
      }
    },
    //跳转至某分类下的文章列表
    redictIndex: function (e) {
      //console.log('查看某类别下的文章');  
      var id = e.currentTarget.dataset.id;
      var name = e.currentTarget.dataset.item;
      var url = '../list/list?categoryID=' + id;
      uni.navigateTo({
        url: url
      });
    },
	// 点击
	quanzi(tieid) {
		console.log('点击',tieid); 
		var url = '../quan/quanzi?&id='+tieid;
		uni.navigateTo({
			url: url
		});
	}
  }
};
</script>
<style>
@import "./quan.css";
page {
	background-color: #f3f4f7;
}
</style>